import os
from ppgnss import gnss_time

url = "http://ftp.aiub.unibe.ch/CODE/2019/CODG0110.19I.Z"
data_dir = "./data"

year_from, year_to = 2019, 2020

for year in range(year_from, year_to+1):
    days = gnss_time.total_days(year)
    for doy in range(1, days+1):
        url = "http://ftp.aiub.unibe.ch/CODE/%04d/CODG%03d0.%02dI.Z" % (year, doy, year-2000)
        cmd = "wget -P %s %s" %(data_dir, url)
        print(cmd)
        os.system(cmd)
